package com.shilei.strategy;

import com.shilei.Bullet;
import com.shilei.common.Dir;
import com.shilei.Tank;

import java.io.Serializable;

/**
 * @description: 超级开火策略
 * @author: 81271
 * @date: 2020-04-12 16:46
 */
public class SuperFireStrategy implements FireStrategy, Serializable {
    @Override
    public void fire(Tank tank) {
        int eX = tank.getX() + Tank.WIDTH/2 - Bullet.WIDTH/2;
        int eY = tank.getY() + Tank.HEIGHT/2 - Bullet.HEIGHT/2;

        for (Dir dir: Dir.values()) {
            new Bullet(eX, eY, dir, tank.getGroup());

        }
    }
}
